{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!--BOOK_INFORMATION-->\n",
    "<img align=\"left\" style=\"padding-right:10px;\" src=\"figures/PHydro-cover-small.png\">\n",
    "*This is the Jupyter notebook version of the [Python in Hydrology](http://www.greenteapress.com/pythonhydro/pythonhydro.html) by Sat Kumar Tomer.*\n",
    "*Source code is available at [code.google.com](https://code.google.com/archive/p/python-in-hydrology/source).*\n",
    "\n",
    "*The book is available under the [GNU Free Documentation License](http://www.gnu.org/copyleft/fdl.html). If you have comments, corrections or suggestions, please send email to satkumartomer@gmail.com.*"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!--NAVIGATION-->\n",
    "< [Choosing the Name of Variable](02.03-Choosing-the-Name-of-Variable.ipynb) | [Contents](Index.ipynb) | [Expressions](02.05-Expressions.ipynb) >"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2.4 运算符和操作符\n",
    "\n",
    "运算符(`Operators`)是用于表示像相加和相乘计算的特殊符号。用于运算符中的值被称为操作符。假设变量a容纳2，b容纳5.\n",
    "\n",
    "|Operator|   Name |  Example  |\n",
    "|--------|:------:|:---------:|\n",
    "|+|Plus|>>> a+b|\n",
    "|||7|\n",
    "|-|Minus|>>> a-b|\n",
    "||| -3|\n",
    "|*|Multiply|>>> a*b|\n",
    "|||10|\n",
    "|/|Divide|>>> a/b|\n",
    "|||0 (for Python 2.x)|\n",
    "|||0.4 (for Python 3.x)|\n",
    "|**|Power|>>> a**b|\n",
    "|||32|\n",
    "|%|Modulo|>>> b\\%a|\n",
    "|||1|\n",
    "|==|Equal to|>>> a==b|\n",
    "|||False|\n",
    "|<|Less than|>>>a<b|\n",
    "|||True|\n",
    "|>|Greater than|>>>a>b|\n",
    "|||False|\n",
    "|<=|Less than or Equal to|>>> a<=b|\n",
    "|||True|\n",
    "|>=|Greater than or Equal to|>>>a>=b|\n",
    "|||False|\n",
    "|!=|Not equal to|>>>a!=b|\n",
    "|||True|\n",
    "|and|And|>>> True and False|\n",
    "|||False|\n",
    "|or|Or|>>> True or False|\n",
    "|||True|\n",
    "|not|Not|>>> not True|\n",
    "|||False|\n",
    "|+ =|Add AND assignment|>>> a += b|\n",
    "|||7|\n",
    "|-=|Subtract AND assignment|>>> a -= b|\n",
    "|||3|\n",
    "|*=|Multiply AND assignment|>>> a *= b|\n",
    "|||10|\n",
    "|/ =|Divide AND assignment|>>> a /= b|\n",
    "|||0|\n",
    "|% =|Modulus AND assignment|>>> a %= b|\n",
    "|||2|\n",
    "|**=|Exponent AND assignment|>>> a **= b|\n",
    "|||32|\n",
    "|// =|Floor division AND assignment|>>> a //= b|\n",
    "|||0|"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
